<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div id="header_left">
					<img src="images/logo.png" alt="cake" class="logo"/>
				</div>
				<div style="padding-top:20px;">
					<input type="text" id="keywords" name="keywords"/>
					<input type="image" src="images/search.jpg" id="search" value="search" onclick="search();"/>
					<span class=" btn" style="margin-left:50px;">
						<%
	    				String username=null;
	    				
	    				Cookie[] cookies=request.getCookies();
	    				if(cookies!=null)
	    				{
	    					for(Cookie c:cookies)
		    				{
		    					String name=c.getName();
		    					if(name.equals("username"))
		    					{
		    						username=c.getValue();
		    						session.setAttribute("username",username);
		    					}
		    					if(name.equals("userid"))
		    					{
		    						session.setAttribute("userid",c.getValue());
		    					}
		    				}
		    			}
	    				if(username==null|| username.equals(""))
	    				{
	    					username=(String)session.getAttribute("username");
	    				}
						
	    				if(username==null || username.equals(""))
	    				{
					%>
			    			<span class="pointer" onclick="toURL('login.jsp');">Login | </span>
						<span class="pointer" onclick="toURL('regist.jsp');">Register</span>
	    			<%
	    				}else
	    				{
   					%>
   							Welcome: <%=username %> &nbsp;&nbsp;&nbsp;&nbsp;
   							<span class="pointer" onclick="toURL('myOrder.jsp');">MyOrders |</span>
   							<span class="pointer" onclick="quit();">Quit</span>
   					<%
	    				}
	    			%>
						
					</span>
					
					<span style="margin-left:20px;cursor:pointer;" onclick="toURL('msgBoard.jsp');">MsgBoard</span>
				</div>
				<div id="navigation">
					<ul>
						<li><a href="index.jsp">Home</a> |</li>
						<li><a href="cakes.jsp">Reservation</a> |</li>
						<li><a href="advanced.jsp">Advanced Reservation</a> |</li>
						<li><a href="cakes.jsp?category=5">New Products</a> |</li>
						<%
						if(username==null || username.equals(""))
						{
						%>
						<li><a href="login.jsp">MyOrders</a> |</li>
						<li><a href="login.jsp">Shopping Cart</a> |</li>
						<%
						}
						else
						{
						%>
						<li><a href="myOrder.jsp">MyOrders</a> |</li>
						<li><a href="shoppingCart.jsp">Shopping Cart</a> |</li>
						<%
						}
						%>
						<li><a href="about.jsp">About us</a></li>
					</ul>
				</div>